Skip to main content
Version: 8.4.10.2

VolTimeCalculator

V8 Message Definiton

This table allows custom span risk calculations based on either user or SR supplied input values.

METADATA

AttributeValue
Topic5030-srse-calculators
MLink TokenSRMLinkAnalytics
ProductSRAnalytics
accessTypeSELECT,UPDATE,INSERT,DELETE

Table Definition

FieldTypeKeyDefault ValueComment
ticker_atenum - AssetTypePRI'None'
ticker_tsenum - TickerSrcPRI'None'
ticker_tkVARCHAR(12)PRI''
secTypeenum - SpdrKeyTypePRI'None'
endDateDATEPRI'1900-01-01'period end date CST
userNameVARCHAR(24)PRI''
endTimeTIME(6)'16:00:00'period end time CST
nowDttmDATETIME(6)'2000-01-01'period start time CST
nowSrcenum - FieldSrc'Default'default is clock time when selecting
holidayCalendarenum - CalendarCode'NYSE'
holidayCalendarSrcenum - FieldSrc'Default'
yearsVT70DOUBLE0volatility years from nowDttm to endDttm using TradingCalendar SR NMS TradingVolatility Calendar
yearsY252DOUBLE0
yearsY365DOUBLE0
partialDaysINT0number of partial trading days halfdays between endpoints
holidayDaysINT0number of holidays days that would otherwise be trading days between endpoints
completeDaysINT0number of complete trading days between endpoints
errorVARCHAR(32)''calculation error
timestampDATETIME(6)'2000-01-01'

PRIMARY KEY DEFINITION (Unique)

FieldSequence
ticker_tk1
ticker_at2
ticker_ts3
secType4
endDate5
userName6

CREATE TABLE EXAMPLE QUERY

CREATE TABLE `SRAnalytics`.`MsgVolTimeCalculator` (
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '',
`secType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None',
`endDate` DATE NOT NULL DEFAULT '1900-01-01' COMMENT 'period end date (CST)',
`userName` VARCHAR(24) NOT NULL DEFAULT '',
`endTime` TIME(6) NOT NULL DEFAULT '16:00:00' COMMENT 'period end time (CST)',
`nowDttm` DATETIME(6) NOT NULL DEFAULT '2000-01-01' COMMENT 'period start time (CST)',
`nowSrc` ENUM('Default','User') NOT NULL DEFAULT 'Default' COMMENT 'default is clock time when selecting',
`holidayCalendar` ENUM('None','NYSE','EUREX','CBOE_EU','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE','CME','NYMEX','COMEX','MGEX','BXE','CXE','DXE') NOT NULL DEFAULT 'NYSE',
`holidayCalendarSrc` ENUM('Default','User') NOT NULL DEFAULT 'Default',
`yearsVT70` DOUBLE NOT NULL DEFAULT 0 COMMENT 'volatility years from nowDttm to endDttm using TradingCalendar (SR NMS Trading/Volatility Calendar)',
`yearsY252` DOUBLE NOT NULL DEFAULT 0,
`yearsY365` DOUBLE NOT NULL DEFAULT 0,
`partialDays` INT NOT NULL DEFAULT 0 COMMENT 'number of partial trading days (half-days) between endpoints.',
`holidayDays` INT NOT NULL DEFAULT 0 COMMENT 'number of holidays (days that would otherwise be trading days) between endpoints.',
`completeDays` INT NOT NULL DEFAULT 0 COMMENT 'number of complete trading days between endpoints.',
`error` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'calculation error',
`timestamp` DATETIME(6) NOT NULL DEFAULT '2000-01-01',
PRIMARY KEY USING HASH (`ticker_tk`,`ticker_at`,`ticker_ts`,`secType`,`endDate`,`userName`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='This table allows custom span risk calculations based on either user or SR supplied input values.';

SELECT TABLE EXAMPLE QUERY

SELECT
`ticker_at`,
`ticker_ts`,
`ticker_tk`,
`secType`,
`endDate`,
`userName`,
`endTime`,
`nowDttm`,
`nowSrc`,
`holidayCalendar`,
`holidayCalendarSrc`,
`yearsVT70`,
`yearsY252`,
`yearsY365`,
`partialDays`,
`holidayDays`,
`completeDays`,
`error`,
`timestamp`
FROM `SRAnalytics`.`MsgVolTimeCalculator`
WHERE
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`ticker_at` = 'None'
AND
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`ticker_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`ticker_tk` = 'Example_ticker_tk'
AND
/* Replace with a ENUM('None','Stock','Future','Option','MLeg') */
`secType` = 'None'
AND
/* Replace with a DATE */
`endDate` = '2022-01-01'
AND
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName';

UPDATE TABLE EXAMPLE QUERY

UPDATE `SRAnalytics`.`MsgVolTimeCalculator` 
SET
/* Replace with a TIME(6) */
`endTime` = '12:34:56.000000',
/* Replace with a DATETIME(6) */
`nowDttm` = '2022-01-01 12:34:56.000000',
/* Replace with a ENUM('Default','User') */
`nowSrc` = 'Default',
/* Replace with a ENUM('None','NYSE','EUREX','CBOE_EU','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE','CME','NYMEX','COMEX','MGEX','BXE','CXE','DXE') */
`holidayCalendar` = 'NYSE',
/* Replace with a ENUM('Default','User') */
`holidayCalendarSrc` = 'Default',
/* Replace with a DOUBLE */
`yearsVT70` = 4.56,
/* Replace with a DOUBLE */
`yearsY252` = 4.56,
/* Replace with a DOUBLE */
`yearsY365` = 4.56,
/* Replace with a INT */
`partialDays` = 5,
/* Replace with a INT */
`holidayDays` = 5,
/* Replace with a INT */
`completeDays` = 5,
/* Replace with a VARCHAR(32) */
`error` = 'Example_error',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`ticker_at` = 'None'
AND
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`ticker_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`ticker_tk` = 'Example_ticker_tk'
AND
/* Replace with a ENUM('None','Stock','Future','Option','MLeg') */
`secType` = 'None'
AND
/* Replace with a DATE */
`endDate` = '2022-01-01'
AND
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName';

INSERT TABLE EXAMPLE QUERY

INSERT INTO `SRAnalytics`.`MsgVolTimeCalculator`(
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`ticker_at`,
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`ticker_ts`,
/* Replace with a VARCHAR(12) */
`ticker_tk`,
/* Replace with a ENUM('None','Stock','Future','Option','MLeg') */
`secType`,
/* Replace with a DATE */
`endDate`,
/* Replace with a VARCHAR(24) */
`userName`,
/* Replace with a TIME(6) */
`endTime`,
/* Replace with a DATETIME(6) */
`nowDttm`,
/* Replace with a ENUM('Default','User') */
`nowSrc`,
/* Replace with a ENUM('None','NYSE','EUREX','CBOE_EU','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE','CME','NYMEX','COMEX','MGEX','BXE','CXE','DXE') */
`holidayCalendar`,
/* Replace with a ENUM('Default','User') */
`holidayCalendarSrc`,
/* Replace with a DOUBLE */
`yearsVT70`,
/* Replace with a DOUBLE */
`yearsY252`,
/* Replace with a DOUBLE */
`yearsY365`,
/* Replace with a INT */
`partialDays`,
/* Replace with a INT */
`holidayDays`,
/* Replace with a INT */
`completeDays`,
/* Replace with a VARCHAR(32) */
`error`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'None',
'None',
'Example_ticker_tk',
'None',
'2022-01-01',
'Example_userName',
'12:34:56.000000',
'2022-01-01 12:34:56.000000',
'Default',
'NYSE',
'Default',
4.56,
4.56,
4.56,
5,
5,
5,
'Example_error',
'2022-01-01 12:34:56.000000'
);

DELETE TABLE EXAMPLE QUERY

DELETE FROM `SRAnalytics`.`MsgVolTimeCalculator` 
WHERE
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`ticker_at` = 'None'
AND
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`ticker_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`ticker_tk` = 'Example_ticker_tk'
AND
/* Replace with a ENUM('None','Stock','Future','Option','MLeg') */
`secType` = 'None'
AND
/* Replace with a DATE */
`endDate` = '2022-01-01'
AND
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName';

Doc Columns Query

SELECT * FROM SRAnalytics.doccolumns WHERE TABLE_NAME='VolTimeCalculator' ORDER BY ordinal_position ASC;